package com.itheima.d3_dateTime;

import java.util.Date;

public class Test1Date {
    public static void main(String[] args) {
        // 创建日期对象
        Date  date = new Date();
        System.out.println(date);

        //拿到时间毫秒值
        long time = date.getTime();
        System.out.println(time);

        //把时间毫秒值转换为日期对象：2s后的时间是多少
        Date date2 = new Date(time + 2*1000);
        System.out.println(date2);

        //把时间对象用settime方法修改
        date.setTime(time + 2*1000);
        System.out.println(date);
    }
}
